const bssBase = '/bss';
const IAM_SERVER = '/IAM-ADMIN';
// const bssBase = "";
// 查询项目
const queryProjects = {
    url: `${bssBase}/v1/projects`,
    method: 'GET',
    pro: 'projects',
};
// 查询项目基本信息
const queryProjectsInfo = (instanceId) => {
    return {
        url: `${bssBase}/v1/projects/${instanceId}`,
        method: 'GET',
    };
};
// 项目配额校验
const getQuotaCheck = {
    url: `${bssBase}/v1/project/quota-check`,
    method: 'POST',
};
// 创建项目
const createProjects = {
    url: `${bssBase}/v1/projects`,
    method: 'POST',
};
// 项目更新
const updateProjects = (instanceId) => {
    return {
        url: `${bssBase}/v1/projects/${instanceId}`,
        method: 'PUT',
    };
};
// 项目删除
const deleteProjects = (instanceId) => {
    return {
        url: `${bssBase}/v1/projects/${instanceId}`,
        method: 'DELETE',
    };
};
// 项目禁用、启动
const enableProjects = (instanceId) => {
    return {
        url: `${bssBase}/v1/projects-enable/${instanceId}`,
        method: 'PUT',
    };
};
// 查询项目下的组织人员
const getProjectUser = {
    url: `${bssBase}/v1/projects/getProjectUser`,
    method: 'GET',
};
// 查询租户下的人员-为项目所用
const getProjectRelationUser = {
    url: `${bssBase}/v1/projects/can-relation-user`,
    method: 'GET',
};
// 创建主租户
const addMasterTenant = {
    url: `${bssBase}/v1/masterTenant/add`,
    method: 'POST',
};
// 绑定主租户和云上账号
const addMasterRegionRelation = {
    url: `${bssBase}/v1/masterTenant/addMasterTenantRegionRelation`,
    method: 'POST',
};
// 租户code重复性校验
const checkMasterTenantCode = (masterTenantCode) => {
    return {
        url: `${bssBase}/v1/masterTenant/masterTenantCode/check/${masterTenantCode}`,
        method: 'GET',
    };
};
// 项目资源迁移
const moveProjectRes = {
    url: `${bssBase}/v1/project/moveProjectRes`,
    method: 'PUT',
};
// 查询人员
const getStaffPageList = {
    url: `${IAM_SERVER}/iam-admin/uc/v1/staff/getStaffPageList`,
    method: 'GET',
    pro: ['data', 'data.list'],
};
// 人员登录名重复性校验
const checkStaffLoginName = (loginName) => {
    return {
        url: `${IAM_SERVER}/iam-admin/ling/uc/v1/staff/check/loginName/${loginName}`,
        method: 'GET',
    };
};
const updateStaffStatus = (staffId, staffStatus) => {
    return {
        url: `${IAM_SERVER}/iam-admin/uc/v1/staff/updateStaffStatus/?staffId=${staffId}&staffStatus=${staffStatus}`,
        method: 'POST',
    };
};
// 查询组织机构
const queryOrgList = {
    url: `${IAM_SERVER}/iam-admin/uc/v1/org/listOrTree`,
    method: 'GET',
};
// 组织机构排序序号重复性校验
const checkOrgSort = (parentOrg, sort) => {
    return {
        url: `${IAM_SERVER}/iam-admin/ling/uc/org/checkSort/${parentOrg}/${sort}`,
        method: 'GET',
    };
};
// 根据code获取组织机构信息
const getByOrgCode = {
    url: `${IAM_SERVER}/iam-admin/uc/v1/org/getByOrgCode`,
    method: 'GET',
};
// 添加组织
const addOrg = {
    url: `${IAM_SERVER}/iam-admin/ling/uc/org/addOrg`,
    method: 'POST',
};
// 修改组织
const updOrg = {
    url: `${IAM_SERVER}/iam-admin/ling/uc/org/updOrg`,
    method: 'PUT',
};
const delOrg = (orgId) => {
    return {
        url: `${IAM_SERVER}/iam-admin/ling/uc/org/delOrg/${orgId}`,
        method: 'DELETE',
    };
};
const udpOrganizationStatus = (orgId, status) => {
    return {
        url: `${IAM_SERVER}/iam-admin/ling/uc/org/udpOrganizationStatus?orgId=${orgId}&status=${status}`,
        method: 'PUT',
    };
};
/* ---------------------- 角色 --------------------*/
// 查询角色
const queryRoleList = {
    url: `${IAM_SERVER}/iam-admin/role/pageGetRoleList`,
    method: 'GET',
};
// 查询角色详细信息
const queryRoleInstance = {
    url: `${IAM_SERVER}/iam-admin/role/getRole`,
    method: 'GET',
};
// 删除角色
const delectRoleList = {
    url: `${IAM_SERVER}/iam-admin/role/deleteRole`,
    method: 'DELETE',
};
// 添加角色
const addRoleList = {
    url: `${IAM_SERVER}/iam-admin/role/addRole`,
    method: 'POST',
};
// 更新角色
const updateRoleList = {
    url: `${IAM_SERVER}/iam-admin/role/updateRole`,
    method: 'PUT',
};

// 修改个人信息
const updateStaff = {
    url: `${IAM_SERVER}/iam-admin/uc/v1/staff/updateStaff`,
    method: 'PUT',
};
// 根据用户id或登录名获取用户信息
const getStaffByStaffIdOrLoginName = {
    url: `${IAM_SERVER}/iam-admin/uc/v1/staff/getStaffByStaffIdOrLoginName`,
    method: 'GET',
};
// 获取登录人员
const getOnlineCount = {
    url: `${IAM_SERVER}/iam-admin/uc/v1/staff/getOnlineCount`,
    method: 'GET',
};

// 添加用户
const addStaff = {
    url: `${IAM_SERVER}/iam-admin/ling/uc/v1/staff/addStaff`,
    method: 'POST',
};

// 删除用户
const delStaff = (loginName) => {
    return {
        url: `${IAM_SERVER}/iam-admin/ling/uc/v1/staff/delStaff/${loginName}`,
        method: 'DELETE',
    };
};

// 编辑用户
const updStaff = {
    url: `${IAM_SERVER}/iam-admin/ling/uc/v1/staff/updStaff`,
    method: 'PUT',
};
// 人员-重置密码
const adminResetStaffPwd = {
    url: `${IAM_SERVER}/iam-admin/ling/uc/v1/staff/adminResetStaffPwd`,
    method: 'PUT',
};
// 登录用户获取邮箱验证码
const sendLoginUserVerifyCode = {
    url: `${IAM_SERVER}/iam-admin/ling/uc/v1/staff/sendLoginUserVerifyCode`,
    method: 'GET',
};
/* -------------------- 菜单按钮 ------------------- */
// 获取该角色所管辖的平台下应用系统的所有菜单
const menuGetMenuList = {
    url: `${IAM_SERVER}/iam-admin/menu/getManagerMenuList`,
    method: 'GET',
};
// 这个接口只能获取角色已分配的所有菜单
const roleGetMenuList = {
    url: `${IAM_SERVER}/iam-admin/menu/v1/getMenu`,
    method: 'GET',
};
// 根据id获取菜单
const menuGetMenuInstance = {
    url: `${IAM_SERVER}/iam-admin/menu/getMenu`,
    method: 'GET',
};
// 删除菜单
const menuDelete = {
    url: `${IAM_SERVER}/iam-admin/menu/delete`,
    method: 'DELETE',
};
// 添加菜单
const menuAdd = {
    url: `${IAM_SERVER}/iam-admin/menu/add`,
    method: 'POST',
};
// 编辑菜单
const menuUpdate = {
    url: `${IAM_SERVER}/iam-admin/menu/update`,
    method: 'PUT',
};
/* -------------------- 配额 ------------------- */
// 配额列表查询
const getProjectQuotas = () => {
    return {
        url: `${bssBase}/v1/project/getProjectQuotas`,
        method: 'GET',
    };
};
// 配额列表项查询
const queryQuotaColumn = {
    url: `${bssBase}/v1/quota/header`,
    method: 'GET',
};

// 租户配额列表查询
const getTenantQuotas = () => {
    return {
        url: `${bssBase}/v1/tenant/getTenantQuotas`,
        method: 'GET',
    };
};

// 项目配额添加
const projectAddQuota = () => {
    return {
        url: `${bssBase}/v1/project/quota-save`,
        method: 'POST',
    };
};

// 项目配额更新
const projectUpdateQuota = () => {
    return {
        url: `${bssBase}/v1/project/quota-update`,
        method: 'POST',
    };
};

// 租户分配配额
const tenantAddQuota = () => {
    return {
        url: `${bssBase}/v1/tenant/createMasterTenantQuota`,
        method: 'POST',
    };
};

// 删除配额
const deleteQuota = () => {
    return {
        url: `${bssBase}/v1/project/deleteQuota`,
        method: 'DELETE',
    };
};

// 查询项目配额指定配额的总量、使用量、已使用量
const queryQuotaQuantity = (projectId, regionId, azUuid, codeStr) => {
    return {
        url: `${bssBase}/v1/project/quota/${projectId}/${regionId}/${azUuid}/${codeStr}`,
        method: 'GET',
    };
};

/* -------------------- 消息发布 ------------------- */
const messageBase = '/message';

// 消息列表查询
const getMessageList = {
    url: `${messageBase}/v1/message/message-list`,
    method: 'GET',
};

// 消息详情查询
const getMessageInstance = (ID) => {
    return {
        url: `${messageBase}/v1/message/${ID}`,
        method: 'GET',
    };
};

// 消息添加/编辑
const addMessage = {
    url: `${messageBase}/v1/message`,
    method: 'POST',
};

// 消息发布
const reissueMessage = (ID) => ({
    url: `${messageBase}/v1/message/reissue/${ID}`,
    method: 'PUT',
});

// 消息删除
const deleteMessage = (ID) => ({
    url: `${messageBase}/v1/message/${ID}`,
    method: 'DELETE',
});

/* -------------------- 文件操作 ------------------- */
const fileBase = 'file';

// 文件上传
const uploadFile = {
    url: `/${fileBase}/v1/upload`,
    method: 'POST',
};

// 文件上传（重命名）
const uploadFile_Rename = {
    url: `/${fileBase}/v1/upload-ren`,
    method: 'POST',
};

// 获取文件url接口
const getObjectUrl = (file_bucket_name, file_name) => ({
    url: `/${fileBase}/v1/get-object-url/${file_bucket_name}/${file_name}`,
    method: 'GET',
});

// 获取文件url接口（默认桶）
const getIniObjectUrl = (file_name) => ({
    url: `/${fileBase}/v1/get-object-url/${file_name}`,
    method: 'GET',
});

// 删除文件
const deleteObjectUrl = (file_bucket_name, file_name) => ({
    url: `/${fileBase}/v1/${file_bucket_name}/${file_name}`,
    method: 'DELETE',
});

// 删除文件（默认桶）
const deleteIniObjectUrl = (file_name) => ({
    url: `/${fileBase}/v1/${file_name}`,
    method: 'DELETE',
});

/* -------------------- 消息中心 ------------------- */
// 系统消息列表查询
const querySysMessage = {
    url: `${messageBase}/v1/message/system-condition-informations`,
    method: 'GET',
};

// 系统消息详情
const querySysMessageInfo = (ID) => {
    return {
        url: `${messageBase}/v1/message/getInformation/${ID}`,
        method: 'GET',
    };
};

// 系统消息删除
const deleteSysMessage = {
    url: `${messageBase}/v1/message/deleteInformation`,
    method: 'DELETE',
};

// 查询系统设置列表
const getSystemSettings = {
    url: `${bssBase}/v1/systemSettings`,
    method: 'GET',
};

// 更新系统设置信息
const updateSystemSettings = {
    url: `${bssBase}/v1/update/systemSettings`,
    method: 'PUT',
};

// 查询AK列表
const queryAkskList = {
    url: `${IAM_SERVER}/iam-admin/aksk/queryAkskList`,
    method: 'GET',
};

// 禁用和启用sk
const handleAksk = {
    url: `${IAM_SERVER}/iam-admin/aksk/change`,
    method: 'PUT',
};

// 删除ak接口
const deleteAksk = {
    url: `${IAM_SERVER}/iam-admin/aksk/deleteById`,
    method: 'DELETE',
};
// 发送邮箱验证码
const sendVerifyCode = {
    url: `${IAM_SERVER}/iam-admin/aksk/sendVerifyCode`,
    method: 'GET',
};

// 下载ak/sk（csv文件）
const downloadCVS = {
    url: `${IAM_SERVER}/iam-admin/aksk/downloadCVS`,
    method: 'GET',
};

// 新增sk
const cteateAksk = {
    url: `${IAM_SERVER}/iam-admin/aksk/verifyCode`,
    method: 'GET',
};
// 查看查看Secret
const queryAkskINfo = {
    url: `${IAM_SERVER}/iam-admin/aksk/getSk`,
    method: 'GET',
};
/* -------------------- 集成平台 ------------------- */
// 应用服务是否开通
const checkApplication = {
    url: `${IAM_SERVER}/iam-admin/application/v1/check`,
    method: 'POST',
};
// 开通应用
const openApplication = {
    url: `${IAM_SERVER}/iam-admin/application/v1/open`,
    method: 'POST',
};

/* -------------------- 接口配置 ------------------- */
// 查询接口列表
const queryInterfaceList = {
    url: `${IAM_SERVER}/iam-admin/interface/listByPage`,
    method: 'GET',
};
// 添加接口
const addInterface = {
    url: `${IAM_SERVER}/iam-admin/interface/add`,
    method: 'POST',
};
// 更新接口
const updateInterface = {
    url: `${IAM_SERVER}/iam-admin/interface/update`,
    method: 'PUT',
};
// 添加接口
const deleteInterface = (ID) => {
    return {
        url: `${IAM_SERVER}/iam-admin/interface/delete/${ID}`,
        method: 'DELETE',
    };
};

const hcpiam = {
    queryProjects,
    queryProjectsInfo,
    getQuotaCheck,
    createProjects,
    updateProjects,
    deleteProjects,
    enableProjects,
    getProjectUser,
    getProjectRelationUser,
    checkMasterTenantCode,
    addMasterRegionRelation,
    addMasterTenant,
    moveProjectRes,
    getStaffPageList,
    checkStaffLoginName,
    updateStaffStatus,
    queryOrgList,
    checkOrgSort,
    getByOrgCode,
    addOrg,
    updOrg,
    delOrg,
    udpOrganizationStatus,
    queryRoleList,
    queryRoleInstance,
    delectRoleList,
    addRoleList,
    updateRoleList,
    updateStaff,
    getStaffByStaffIdOrLoginName,
    getOnlineCount,
    addStaff,
    delStaff,
    updStaff,
    adminResetStaffPwd,
    sendLoginUserVerifyCode,
    menuGetMenuList,
    menuGetMenuInstance,
    menuDelete,
    menuAdd,
    menuUpdate,
    getProjectQuotas,
    queryQuotaColumn,
    projectAddQuota,
    projectUpdateQuota,
    tenantAddQuota,
    deleteQuota,
    queryQuotaQuantity,
    getMessageList,
    getMessageInstance,
    addMessage,
    reissueMessage,
    deleteMessage,
    uploadFile,
    uploadFile_Rename,
    getTenantQuotas,
    getObjectUrl,
    getIniObjectUrl,
    deleteObjectUrl,
    deleteIniObjectUrl,
    querySysMessage,
    querySysMessageInfo,
    deleteSysMessage,
    getSystemSettings,
    updateSystemSettings,
    queryAkskList,
    handleAksk,
    deleteAksk,
    sendVerifyCode,
    downloadCVS,
    cteateAksk,
    queryAkskINfo,
    checkApplication,
    openApplication,
    roleGetMenuList,
    queryInterfaceList,
    addInterface,
    updateInterface,
    deleteInterface,
};
export default hcpiam;
